package com.lz.kunkun.messageservice.util;

import java.io.File;

import org.springframework.web.multipart.MultipartFile;

import com.lz.kunkun.messageservice.GlobalConstant;

public class FileUtil {
public static String fileSave(MultipartFile file) {
	String path="";
	if(null==file||file.isEmpty()) {
		return path;
	}
	try {
	path=GlobalConstant.FILESAVE_PATH+file.getOriginalFilename();
	File f=new File(path);
	if(!f.exists()) {
		f.createNewFile();
	}
	file.transferTo(f.getAbsoluteFile());
	}catch(Exception e) {
		e.printStackTrace();
	}
	return path;
}

}
